vim.g.Lf_ShortcutF = "<leader>ff"

local default_opts = {noremap = true, silent = true}
vim.api.nvim_set_keymap('n', '<leader>fb', ':<C-U><C-R>=printf("Leaderf buffer %s", "")<CR><CR>', default_opts)
vim.api.nvim_set_keymap('n', '<leader>fm', ':<C-U><C-R>=printf("Leaderf mru %s", "")<CR><CR>', default_opts)
vim.api.nvim_set_keymap('n', '<leader>ft', ':<C-U><C-R>=printf("Leaderf bufTag %s", "")<CR><CR>', default_opts)
vim.api.nvim_set_keymap('n', '<leader>fl', ':<C-U><C-R>=printf("Leaderf line %s", "")<CR><CR>', default_opts)

vim.g.Lf_UseCache = 0
vim.g.Lf_UseVersionControlTool = 0
vim.g.Lf_UseMemoryCache = 0
vim.g.Lf_PreviewInPopup = 1
vim.g.Lf_StlSeparator = { left = '', right = '', font = "DejaVu Sans Mono for Powerline" }
vim.g.Lf_PreviewResult = {Function = 1, BufTag = 0, File = 1}
-- 根目录模式
vim.g.Lf_WorkingDirectoryMode = 'AF'
vim.g.Lf_RootMarkers = {'.git', '.svn', '.hg', '.project', '.root'}
-- autocmd BufNewFile,BufRead X:/yourdir* let g:Lf_WildIgnore={'file':['*.vcproj', '*.vcxproj'],'dir':[]}
vim.g.Lf_WildIgnore = {
  file = {'*.vcproj', '*.vcxproj', '*.exe', '*.so', '*.sw?', '*.o', '*.py[co]'},
  dir = {'.git', '.node_modules', '.hg'},
}
vim.g.Lf_StlColorscheme = 'powerline'

vim.cmd [[
if has('nvim')
  let s:cachedir = expand(stdpath('cache'))
  let s:configdir = expand(stdpath('config'))
else
  "vim will share same folder with nvim
  if has('win32')
    let s:cachedir = expand('~/AppData/Local/Temp/cache/nvim')
    let s:configdir = expand('~/AppData/Local/nvim')
  else
    let s:cachedir = expand('~/.cache/nvim')
    let s:configdir = expand('~/.config/nvim')
  endif
endif
let g:Lf_CacheDirectory = s:cachedir
]]
